#ifndef _MATRIX_H_
#define _MATRIX_H_

#include "stdafx.h"

namespace aiRobots
{
	#define MSIZE 16
	typedef float mtype;

	class Matrix
	{
	private:
		int RowNum;
		int ColNum;
		int Length;

		mtype Value[MSIZE]; 

	protected:

	public:
		Matrix();
		Matrix(int row, int col);
		Matrix(int row, int col, mtype value);
		Matrix(int row, int col, mtype* value);
		//~Matrix();

		void Renew(int row, int col);
		void Renew(int row, int col, mtype value);
		void Renew(int row, int col, mtype* value);
		void SetDiagonal(mtype value);
		void SetValue(mtype value);
		void SetValue(int row, int col, mtype value);
		void SetValue(mtype* value);
		void GetValue(mtype* value);
		mtype GetValue(int row, int col);
		int GetRowNum();
		int GetColNum();

		Matrix Transpose();
		bool Inverse(Matrix &destination);

		void Print();

		Matrix operator=(const Matrix &m);
		Matrix operator+(const Matrix &m);
		Matrix operator-(const Matrix &m);
		Matrix operator*(const Matrix &m);
		Matrix operator*(mtype a);
		Matrix operator/(mtype a);
	};
}

#endif